<table class="table table-striped">
    {% for politician in politicians %}
        {% include 'core/candidates/row.html' %}
    {% endfor %}
</table>
<nav class="text-center">
    <ul class="pagination">
        <li {% if not politicians.has_previous %}class="disabled"{% endif %}>
            {% if politicians.has_previous %}
            <a href="{% url 'candidates' %}?page={{ politicians.previous_page_number }}{% for k, v in request.GET.iteritems %}&amp;{{k}}={{v}}{%endfor%}"><span aria-hidden="true">&laquo;</span></a>
            {% else %}
                <a><span aria-hidden="true">&laquo;</span></a>
            {% endif %}
        </li>
        {% for num in politicians.paginator.page_range %}
        <li {% if politicians.number == num %}class="active"{% endif %}>
          <a href="{% url 'candidates' %}?page={{num}}{% for k, v in request.GET.iteritems %}&amp;{{k}}={{v}}{%endfor%}">{{num}}{% if politicians.number == num %} <span class="sr-only">(current)</span>{% endif %}</a>
        </li>
        {% endfor %}
        <li {% if not politicians.has_next %}class="disabled"{% endif %}>
            {% if politicians.has_next %}
                <a href="{% url 'candidates' %}?page={{ politicians.next_page_number }}{% for k, v in request.GET.iteritems %}&amp;{{k}}={{v}}{%endfor%}"><span aria-hidden="true">&raquo;</span></a>
            {% else %}
                <a><span aria-hidden="true">&raquo;</span></a>
            {% endif %}
        </li>
    </ul>
</nav>
